<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>iframe测试无刷新显示小窗</title>
</head>
<body>

<input id="test" type="text" value="https://www.bilibili.com/">
<button class="btn" onclick="go()" type="button">提交</button>

<iframe id="ifame" style="width: 1000px;height: 500px;align-content: center"></iframe>

<script>
    function go() {
        document.getElementById("ifame").src = document.getElementById("test").value;
        //这里是将标签中写的内容赋值到src下
    }
</script>

</body>
</html>